Skip to content

fix: resolve clippy lints and update dependencies#65

Merged
rrrodzilla merged 11 commits into
mainfrom
fix/clippy-lints
Oct 5, 2025
Merged

fix: resolve clippy lints and update dependencies#65
rrrodzilla merged 11 commits into
mainfrom
fix/clippy-lints

Conversation

@rrrodzilla

Copy link
Copy Markdown
Owner

Summary

  • Replaces deprecated ring::constant_time::verify_slices_are_equal with subtle crate
  • Fixes doc comment indentation for clippy compliance
  • Updates dependencies to latest compatible versions
  • Adds compile-time checks for incompatible feature combinations

Changes

  • Deprecated function replacement: Uses subtle::ConstantTimeEq for constant-time comparisons
  • Documentation fixes: Corrects indentation in doc comments to satisfy clippy
  • Dependency updates: Updates aes (0.7→0.8), thiserror (1.x→2.0), rand_core (0.6→0.9), primes (0.3→0.4)
  • Feature validation: Prevents compilation with conflicting version/purpose features

Impact

  • Removes all clippy warnings with -D warnings enabled
  • Maintains constant-time security guarantees with subtle crate
  • Prevents misuse of incompatible feature flags at compile time

Migrate to use separate ctr crate following RustCrypto best practices.
The aes 0.8 release removed the ctr feature, requiring use of the
standalone ctr crate for AES-CTR mode operations.

Changes:
- Update aes dependency to 0.8 (remove ctr feature)
- Add ctr 0.9 dependency
- Update v1_local and v3_local cipher implementations to use new API
- Add ctr feature to v1_local and v3_local feature flags

All feature combinations tested and passing.

Closes #54
Prevents cryptic trait conflict errors by detecting incompatible feature
combinations at compile time with clear error messages.

Changes:
- Add compile_error! macros for conflicting public features
- Configure docs.rs to avoid --all-features (use default features)
- Document architectural design decisions in Cargo.toml

The PASETO specification recommends using a single version per application.
Multiple public features cause conflicting From<ed25519_dalek::ed25519::Error>
implementations. These checks enforce this design at compile time.

Error messages guide users to:
- Choose only one public feature
- Reference issue #48 for context
- Understand this is intentional design

Docs.rs configuration prevents build failures by using default features
(batteries_included + v4_local + v4_public) instead of --all-features.

Addresses #48
Update rand_core dependency to latest compatible version.

All 8 feature combinations tested and passing:
- v1_local: 12 tests passed
- v2_local: 14 tests passed
- v3_local: 16 tests passed
- v4_local: 13 tests passed
- v1_public: 8 tests passed
- v2_public: 10 tests passed
- v3_public: 7 tests passed
- v4_public: 10 tests passed
Update thiserror dependency from 1.0.69 to 2.0.17. All tests pass
across the entire feature matrix (v1-v4, local and public).

Changes include automatic clippy fixes for code style issues.
Update primes from 0.3 to 0.4 in dev dependencies.
Resolve clippy::doc-lazy-continuation warnings by properly indenting
continuation lines in documentation comments.
Remove redundant parentheses from impl trait parameter types in
function signatures for all PASETO version implementations.
Replace ring::constant_time::verify_slices_are_equal with subtle crate's
ConstantTimeEq trait for constant-time byte comparison. The subtle crate
is already present as a transitive dependency and provides the same
security guarantees.
Add subtle 2.6 as a direct dependency for constant-time operations.
While already present as a transitive dependency, explicit declaration
is required to import and use its ConstantTimeEq trait.
Use PasetoError::Cryption for MAC tag comparison failures instead of
non-existent InvalidToken variant. This maintains security by providing
a general unspecified cryptographic error.
Use bool::from() for explicit type conversion of subtle::Choice to bool
to satisfy type inference requirements.
@rrrodzilla
rrrodzilla marked this pull request as ready for review October 5, 2025 19:46
@rrrodzilla
rrrodzilla merged commit 956234c into main Oct 5, 2025
22 checks passed
@rrrodzilla
rrrodzilla deleted the fix/clippy-lints branch October 5, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant